from wcs.libs.players import players
from wcs.libs.items import items

itemName = 'Long Jump'
item = items.addItem(itemName)
item.setGroup("special")
item.setCost(5000)
item.setDescription("Jump twice as far")
item.setMaxCount(1)
item.aliveToUse = True

def wcs_item_bought(event_var):
    """
    Executed when an item is brought. If the item bought was this item, then
    ensure that we reassign their jump multiplier to 2.0
    """
    if event_var['item'] == itemName:
        userid = event_var["userid"]
        player = players[userid]
        player.jumpMultiplier = 2.0
